www.gusucode.com > 茶都拼客网全功能版 8 > 茶都拼客网全功能版 8.8源码程序/teasdxmccom/茶都拼客网V8.8(全功能,无限制,完全开源)/admin/Deal_cp.asp

    <!--#include file="../Ku_inc/Ku_sql.asp"-->
<!--#include file="../Ku_inc/Ku_config.asp"-->
<!--#include file="Ku_conn.asp"-->
<!--#include file="../Ku_inc/inc.asp"-->
<!-- #include file="Session.asp"-->
<%
if request("action")="del" then
if Trim(Request("ID"))="" then
	FoundErr=True
	Message=Message & "<li>请您选择要删除的产品!</li>"
else
	call Del()
end if

if FoundErr<>True then
	Sub Del()
		'删除信息
		sql = "delete from Gu_pro where ID in ("& Trim(Request("ID")) &")"
		conn.execute (sql)
	End Sub
	'成功提示	   
    response.Write("<script>alert(""删除产品成功!"");location.href=""cp_list.asp"";</script>")
end if

if FoundErr=True then
	call ErrMsg(Message)
end if
end if
%>

<%
if request("action")="tisheng" then
if Trim(Request("ID"))="" then
	FoundErr=True
	Message=Message & "<li>请您选择要操作的产品!</li>"
else
	call strPeak()
end if

if FoundErr<>True then
	Sub strPeak()
		adoSQL="update Gu_pro set addtime=now() where ID=" & Trim(Request("ID")) & ""
		conn.execute(adoSQL)
	End Sub
	'成功提示	   
    response.Write("<script>alert(""提升产品成功!"");location.href=""cp_list.asp"";</script>")
end if

if FoundErr=True then
	call ErrMsg(Message)
end if
end if
%>
<%

if request("action")="add" then
name=Checkin(trim(Request.form("name")))
    If name="" Then
    Response.Write "<script>alert(""产品分类名称不能为空!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    set rs=server.createobject("adodb.recordset")
    sql="select * from Shangjia_kind where name='"&name&"'"
    rs.open sql,conn,1,3
    if (rs.eof and rs.bof) then
    rs.addnew

    rs("name")=name
    rs.update
    rs.close
    response.Write("<script>alert(""添加产品分类成功!"");location.href=""cp_kind.asp"";</script>")
    else
    response.Write("<script>alert(""产品分类已存在!"");location.href=""cp_kind.asp"";</script>")
    end if
    end if 

%>
<%
if request("action")="shenhe" then

id=request("id")

    set rs=server.createobject("adodb.recordset")
    sql="select * from Gu_pro where id="&id
    rs.open sql,conn,1,3

    rs("shenhe")=1

    rs.update
    rs.close
    response.Write("<script>alert(""审核产品成功!"");location.href=""cp_list.asp"";</script>")


    end if 

%>
<%
if request("action")="edit" then
name=Checkin(trim(Request.form("name")))
id=request("id")
    If name="" Then
    Response.Write "<script>alert(""网站名称不能为空!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    set rs=server.createobject("adodb.recordset")
    sql="select * from Shangjia_kind where id="&id
    rs.open sql,conn,1,3
    


    rs("name")=name

    rs.update
    rs.close
    response.Write("<script>alert(""修改产品成功!"");location.href=""cp_kind.asp"";</script>")


    end if 

%>
<%
if request("action")="addcp" then
name=strLeach(trim(Request.form("name")))
pic=strLeach(trim(Request.form("pic")))
zuozhe=strLeach(trim(Request.form("zuozhe")))
jifen=strLeach(trim(Request.form("jifen")))
http=strLeach(trim(Request.form("http")))
url=strLeach(trim(Request.form("url")))
content=server.HTMLEncode(trim(Request.form("content")))
big=strLeach(trim(Request.form("big")))
yanshi=strLeach(trim(Request.form("http")))
classs=request("class")
jifen=request("jifen")
star=request("star")
vipjf=request("vipjf")
    If name="" Then
    Response.Write "<script>alert(""产品名称不能为空!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if

    if IsNumeric(jifen)=false then
    Response.Write "<script>alert(""积分只能为数字!"");location.href=""javascript:history.back()"";</script>"
    end if
    
    if IsNumeric(vipjf)=false then
    Response.Write "<script>alert(""VIP积分只能为数字!"");location.href=""javascript:history.back()"";</script>"
    end if
    If url="" Then
    Response.Write "<script>alert(""下载地址不能为空!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    
    
    If content="" Then
    Response.Write "<script>alert(""软件介绍不能为空!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    
    set rsdown=server.createobject("adodb.recordset")
    sqldown="select * from Gu_pro "
    rsdown.open sqldown,conn,1,3
    rsdown.addnew
    
    rsdown("name")=name
    rsdown("class")=classs
    rsdown("jifen")=jifen
    rsdown("big")=big
    rsdown("addtime")=now()
    rsdown("writer")=zuozhe
    rsdown("pic")=pic
    rsdown("url")=url
    rsdown("content")=content
    rsdown("star")=star
    rsdown("yanshi")=yanshi
    rsdown("shenhe")=1
    if request("tuijian")<>"" then
    rsdown("tuijian")=request("tuijian")
    end if
    if pic<>"" then
        rsdown("yespic")=1    
    end if
    if request("vip")="" then
    rsdown("vip")=0
    else
    rsdown("vip")=1
    end if
    rsdown("vipjf")=vipjf
    
    rsdown.update
    rsdown.close
    response.Write("<script>alert(""添加产品成功!"");location.href=""cp_list.asp"";</script>")

end if
%>
<%
if request("action")="editcp" then
kuid=request("ku_id")
name=strLeach(trim(Request.form("name")))
pic=strLeach(trim(Request.form("pic")))
zuozhe=strLeach(trim(Request.form("zuozhe")))
jifen=strLeach(trim(Request.form("jifen")))
http=strLeach(trim(Request.form("http")))
url=strLeach(trim(Request.form("url")))
content=server.HTMLEncode(Request.form("content"))
big=strLeach(trim(Request.form("big")))
yanshi=strLeach(trim(Request.form("http")))
classs=request("class")
jifen=request("jifen")
vipjf=request("vipjf")
star=request("star")

    If name="" Then
    Response.Write "<script>alert(""产品名称不能为空!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if

    if IsNumeric(jifen)=false then
    Response.Write "<script>alert(""积分只能为数字!"");location.href=""javascript:history.back()"";</script>"
    end if
    if IsNumeric(vipjf)=false then
    Response.Write "<script>alert(""积分只能为数字!"");location.href=""javascript:history.back()"";</script>"
    end if
        

    If url="" Then
    Response.Write "<script>alert(""下载地址不能为空!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    
    
    If content="" Then
    Response.Write "<script>alert(""产品介绍不能为空!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    
    set rsdownedit=server.createobject("adodb.recordset")
    sqldownedit="select * from Gu_pro where id="&kuid
    rsdownedit.open sqldownedit,conn,1,3

    
    rsdownedit("name")=name
    rsdownedit("class")=classs
    rsdownedit("jifen")=jifen
    rsdownedit("big")=big
    rsdownedit("addtime")=now()
    rsdownedit("writer")=zuozhe
    rsdownedit("pic")=pic
    rsdownedit("url")=url
    rsdownedit("content")=content
    rsdownedit("star")=star
    rsdownedit("yanshi")=yanshi
    rsdownedit("shenhe")=1
    if request("tuijian")<>"" then
    rsdownedit("tuijian")=request("tuijian")
    end if
    if pic<>"" then
        rsdownedit("yespic")=1    
    end if
    if request("vip")="" then
    rsdownedit("vip")=0
    else
    rsdownedit("vip")=1
    end if
    rsdownedit("vipjf")=vipjf    
    rsdownedit.update
    rsdownedit.close
        set conn=nothing 
    response.Write("<script>alert(""修改产品成功!"");location.href=""cp_list.asp"";</script>")

end if
%>